<template>
    <div class="big-box">
        <div class="header">
            <img src="../../../../../assets/bigScreen/header4.png" alt="" />
            <div class="backBox" @click="goBack"></div>
        </div>
        <div class="backToBox">
            <div class="backTo" @click="gotoHome">
                <div>返回总窗口</div>
            </div>
            <div class="backTo" @click="backToOne">
                <div>返回上一页</div>
            </div>
        </div>
        <div class="centerBox">
            <div class="sreenTitle">投资人</div>
            <div class="center">

                <div class="box-con" id="title">
                    <!-- <div class="router-line">您所在的位置:首页>{{ tabList[tabAct] }}><span>活动详情</span></div> -->
                    <div class="det-top">
                        <div class="det-tl">
                            <img :src="detail.image[0] == '/' ? baseURL + detail.image : detail.image" alt="暂无图片" v-if="detail.image">
                            <img src="../../../../../assets/photo.png" alt="暂无图片" v-else>
                            <!-- <img :src="detail.image" alt="暂无图片" /> -->
                        </div>
                        <div class="det-tr">
                            <!-- <div class="flex"> -->
                            <h3 style="color: #fff;">{{ detail.name }}</h3>

                            <!-- </div> -->
                            <!-- <div class="det-tag">总经理</div> -->
                            <div class="det-tag">{{ detail.remark }}</div>
                            <div class="det-tag">{{ detail.introduction }}</div>
                            <!-- <div class="det-tr-con">
						<div class="flex">
							<div>企业融资金额：<span style="color: #D31818">3000万元</span></div>
							<div>企业名称：<span>50104024232411</span></div>
						</div>
						<div class="flex">
							<div>融资地区：<span>内蒙古呼和浩特市</span></div>
							<div>统一社会信用代码：<span>内蒙古心悦臣服科技有限公司</span></div>
						</div>
						<div class="flex">
							<div>融资类型：<span>股权融资</span></div>
							<div>所属行业：<span>计算机服务软件业</span></div>
						</div>
						<div class="flex">
							<div>融资形式：<span>新增</span></div>
							<div>所在地区：<span>呼和浩特市</span></div>
						</div>
						<div class="flex">
							<div>担保方式：<span>信用</span></div>
							<div>手机号码：<span>15148086699</span></div>
						</div>
					</div> -->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
import {
    baseUrl
} from '../../../../../../config';
import {
    capitalDetailRecommend1
} from "../../../../../api/globalSearch"
import headerBox from '../../../../../components/header.vue';
import headerImg from '../../../../../components/headerImg.vue';
import footerBox from '../../../../../components/footer-box.vue';
// import actTabs from "./components/act-tabs.vue"
import {
    getInvestorDetail
} from '../../../../../api/capital';
import {
    messageAdd,
    getMessageDet,
    getMessageDetSingle
} from '../../../../../api/message.js';
export default {
    components: {
        headerBox,
        headerImg,
        footerBox
        // actTabs
    },
    data() {
        return {
            list: [],
            baseURL: undefined,
            wrapperStyle: {
                width: '20rem'
            },
            tabList: ['最新资讯', '最新活动'],
            tabAct: 1,
            detail: {},
            detList: [],
            ifChat: false,
            chatData: {},
            chatList: [],
            chatCon: null,
            msgId: null,
            userId: localStorage.getItem("userId")
        };
    },
    mounted() {
        console.log(this.$route.query.id);
        this.baseURL = baseUrl
        this.getDet(this.$route.query.id);
        // this.getDetList(this.$route.query.id);
    },
    methods: {
        getMatch() {
            // console.log(item.id);
            capitalDetailRecommend1({
                industry: this.detail.industry
            }).then((response) => {
                this.list.value = [];
                if (response.code == 200) {
                    this.list = response.data;
                } else {
                    this.list = []
                }
            }).catch(err => {
                this.list = []
            })
        },
        // 阻止点击的默认事件修改路由
        handleAnchorClick(e, link) {
            e.preventDefault();
            var srcolls = document.getElementById(link.href);
            srcolls.scrollIntoView({
                block: 'start',
                behavior: 'smooth'
            });
        },
        toDetail(item, type) {
            console.log(item.id);
            var url = '';
            if (type == 1) { //投资需求
                url = 'capitalDetail'
            }
            // if (type == 3) {
            // url = '/scientificOrgDetail'
            // }
            if (type == 2) { //投资人
                url = 'capitalPersonal'
            }
            this.$router.push({
                path: url,
                query: {
                    id: item.id
                }
            })
        },
        getDet(id) {
            getInvestorDetail(id).then(res => {
                if (res.code === 200) {
                    this.detail = res.data;
                    this.getMatch();
                }
            });
        },
        gotoChat(v) {
            this.chatData = v;
            this.ifChat = true;
            this.msgId = v.id;
            this.getChatDet(v.id);
        },
        getChatDet(id) {
            getMessageDetSingle({
                receiveId: id,
                receiveType: '1',
            }).then(res => {
                if (res.code === 200) {
                    this.chatList = res.data;
                    this.$nextTick(() => {
                        let scrollEl = this.$refs.mianscroll;
                        scrollEl.scrollTo({ top: scrollEl.scrollHeight, behavior: 'smooth' });
                    });
                }
            })
        },
        chatSub() {
            if (this.chatCon) {
                messageAdd({
                    receiveType: 1,//1 投资人  2 经纪人 3融资需求
                    content: this.chatCon,
                    receiveId: this.msgId
                }).then(res => {
                    if (res.code === 200) {
                        this.chatCon = null;
                        this.getChatDet(this.msgId);
                    }
                })
            }
        },

        gotoHome() {
            this.$router.push({
                path: '/bigScreenIndex',
            })
        },
        backToOne() {
            console.log('11');
            this.$router.go(-1)
        },
        goBack() {
            this.$router.push('/chart')
        }
        // getDetList(id) {
        // 	getActivityDetList({id: id}).then(res=>{
        // 		if(res.code === 200) {
        // 			this.detList = res.data?res.data.list:[];
        // 		}
        // 	})
        // },
        // gotoDet(id) {
        // 	this.$router.push({
        // 		path: 'activitiesDetail',
        // 		query: {
        // 			id: id
        // 		}
        // 	})
        // }
    }
};
</script>

<style scoped lang="scss">
@font-face {
    font-family: "ffa";
    src: url(../../../assets/bigScreen/fonts/DS-DIGIB.TTF);
}
ul,
li {
    list-style: none;
}
.big-box {
    background-color: #071c3b;
    height: 100vh;
}
.header {
    position: relative;
    text-align: center;
    position: relative;
    height: 19.1rem;

    .backBox {
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 70rem;
        height: 10rem;
        cursor: pointer;
    }

    > img {
        width: 100%;
        max-height: 100%;
        margin-top: -1.1rem;
        image-rendering: -moz-crisp-edges; /* Firefox */
        image-rendering: -o-crisp-edges; /* Opera */
        image-rendering: -webkit-optimize-contrast; /* Webkit (non-standard naming) */
        image-rendering: crisp-edges;
        -ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) */
    }
}
.centerBox {
    width: 96%;
    margin: 0 auto;
    position: absolute;
    top: 14rem;
    left: 2%;
    .sreenTitle {
        background-image: url("../../../../../assets/bigScreen/sreenTitle.png");
        background-size: 100% 100%;
        height: 3.8rem;
        padding-left: 35px;
        font-weight: 600;
        color: #fff;
        display: flex;
        align-items: center;
    }
    .center {
        margin-top: 1rem;
        height: calc(100vh - 20rem);
        border: 1px solid;
        border-image: linear-gradient(
                130deg,
                #2385df 0%,
                rgba(35, 133, 223, 0.65) 92%
            )
            1;
        overflow-y: scroll;
        padding: 20px;
        .box-con {
            width: 140rem;
            margin: 5rem auto;

            .router-line {
                font-size: 1.8rem;
                line-height: 2.2rem;
                color: #fff;
                padding: 2rem;

                span {
                    color: #fff;
                }
            }

            .det-top {
                border: 0.1rem solid #4494ff46;
                border-radius: 0.8rem;
                display: flex;
                // justify-content: space-between;
                flex-wrap: wrap;
                padding: 4rem;
                background-color: #082853;

                .det-tl {
                    width: 38.4rem;
                    height: 40.8rem;
                    margin-right: 4.5rem;

                    img {
                        width: 100%;
                        height: 100%;
                        object-fit: cover;
                    }
                }

                .det-tr {
                    width: 65rem;

                    h3 {
                        font-size: 2.4rem;
                        line-height: 2.9rem;
                        color: #fff;
                    }

                    .det-tag {
                        font-size: 1.6rem;
                        // line-height: 1.4rem;
                        // color: #fff;
                        color: #fff;
                        padding: 0.4rem 0;
                        border-radius: 0.4rem;
                        margin: 1.4rem auto 2rem;
                        display: inline-block;
                    }

                    .haveIn {
                        background: #ffbd02;
                    }

                    .closed {
                        background: #aeaeae;
                    }

                    .det-tr-con {
                        font-size: 1.8rem;
                        line-height: 2.2rem;
                        color: #7a8189;

                        div {
                            margin-top: 1.3rem;
                        }

                        span {
                            color: #000;
                        }
                    }
                }
            }

            .det-cen {
                border-bottom: 0.2rem solid #edeeef;
                padding-bottom: 9rem;

                h4 {
                    font-size: 2.8rem;
                    line-height: 3.4rem;
                    margin: 3rem 0;
                }

                div {
                    font-size: 1.8rem;
                    line-height: 2.2rem;
                    color: #000;
                }
            }

            .det-bot {
                .h4s {
                    font-size: 2.8rem;
                    line-height: 3.4rem;
                    margin: 5rem 0 3rem;
                }

                .list-l-active {
                    // width: 95rem;
                    display: flex;
                    flex-wrap: wrap;
                    justify-content: space-between;

                    .list-li-active {
                        border: 0.1rem solid #cccccc;
                        border-radius: 0.8rem;
                        width: 46rem;
                        margin-bottom: 4rem;

                        .li-t-active {
                            height: 27.6rem;
                            position: relative;

                            span {
                                position: absolute;
                                top: 1rem;
                                right: 1rem;
                                z-index: 1;
                                font-size: 1.2rem;
                                line-height: 1.4rem;
                                color: #fff;
                                padding: 0.4rem 1.2rem;
                                border-radius: 0.4rem;
                                background: #007fff;
                            }

                            .haveIn {
                                background: #ffbd02;
                            }

                            .closed {
                                background: #aeaeae;
                            }

                            img {
                                width: 100%;
                                height: 100%;
                                border-radius: 0.8rem;
                            }
                        }

                        .li-b-active {
                            padding: 1rem 2rem;

                            h4 {
                                font-size: 2rem;
                                line-height: 2.4rem;
                                color: #000;
                                overflow: hidden;
                                text-overflow: ellipsis;
                                display: -webkit-box;
                                -webkit-box-orient: vertical;
                                -webkit-line-clamp: 2;
                            }

                            .acti-con {
                                margin-top: 0.3rem;

                                div {
                                    margin-top: 1.3rem;
                                    font-size: 1.4rem;
                                    line-height: 1.7rem;
                                    color: #7a8189;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    ::-webkit-scrollbar {
        width: 5px;
        height: 10px;
    }

    /* 滚动条轨道 */
    ::-webkit-scrollbar-track {
        background-color: #234470;
    }

    /* 滚动条滑块 */
    ::-webkit-scrollbar-thumb {
        background-color: #061c57;
    }

    /* 鼠标悬停在滚动条上的滑块 */
    ::-webkit-scrollbar-thumb:hover {
        background-color: #555;
    }
}
.backToBox {
    position: absolute;
    top: 8rem;
    right: 2%;
    display: flex;
    z-index: 10;
    .backTo {
        background-image: url("../../../../../assets/bigScreen/backTo.png");
        color: #2dccff;
        background-size: 100% 100%;
        width: fit-content;
        padding: 2px 40px 10px 10px;
        font-weight: 600;
        cursor: pointer;
        margin-left: 10px;
        div {
            padding-top: 5px;
        }
    }
}
</style>
